Method for object detection using knowledge distillation

ABSTRACT

A method that may include training a student ODNN to mimic a teacher ODNN. The training may include calculating a teacher student detection loss that is based on a pre-bounding-box output of the teacher ODNN. The pre-bounding-box output of the teacher ODNN is a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN. The method may also include detecting one or more objects in an image, by feeding the image to the trained student ODNN; outputting by the trained student ODNN a student pre-bounding-box output; and calculating one or more bounding boxes based on the student pre-bounding-box output.

BACKGROUND

Object detection is required in various systems and applications.

There is a growing need to provide a method and a system that may be able to provide highly accurate object detection at a low cost.

SUMMARY

There may be provided an object detection system that may include a trained student object detection neural network (ODNN) that was trained to mimic a teacher ODNN; wherein the training may include calculating a teacher student detection loss that may be based on a pre-bounding-box output of the teacher ODNN; wherein the pre-bounding-box output of the teacher ODNN may be a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN; wherein the trained student ODNN may be configured to receive an image and output a student pre-bounding-box output that may be indicative of one or more objects in the image; and a bounding box unit that may be configured to receive the student pre-bounding-box output and to calculate one or more bounding boxes based on the student pre-bounding-box output.

There may be provided a non-transitory computer readable medium that may store instructions for: training a student object detection neural network (ODNN) to mimic a teacher ODNN; wherein the training may include calculating a teacher student detection loss that may be based on a pre-bounding-box output of the teacher ODNN; wherein the pre-bounding-box output of the teacher ODNN may be a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN; and detecting one or more objects in an image; wherein the detecting may include : feeding the image to the trained student ODNN; outputting by the trained student ODNN a student pre-bounding-box output; and calculating one or more bounding boxes based on the student pre-bounding-box output.

There may be provided method for object detection, the method may include training a student object detection neural network (ODNN) to mimic a teacher ODNN; wherein the training may include calculating a teacher student detection loss that may be based on a pre-bounding-box output of the teacher ODNN; wherein the pre-bounding-box output of the teacher ODNN may be a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN; and detecting one or more objects in an image; wherein the detecting may include: feeding the image to the trained student ODNN; outputting by the trained student ODNN a student pre-bounding-box output; and calculating one or more bounding boxes based on the student pre-bounding-box output.

The pre-bounding-box outputs of the teacher ODNN may be a weighted sum of the pre-bounding-box output of the different ODNNs; and wherein the method may include calculating, by the teacher ODNN, weights to be applied during a calculation of the weighted sum.

The method wherein each one of the pre-bounding-box outputs of the different ODNNs may include an objectiveness confidence level indicative of an existence of an object; and wherein the calculating of the weights may include applying a function on objectiveness confidence level of the pre-bounding-box outputs of the different ODNNs.

The function may be a softmax function.

The function may be a max function.

The function may be a sigmoid function.

The calculating of the weights may include training a weight learning neural network of the teacher ODNN.

The calculating of the weight may be done per anchor out of a set of anchors.

The method may include calculating the weighted sum of the pre-bounding-box outputs of the different ODNNs by applying different weights to different parts of the pre-bounding-box outputs of the different ODNNs.

BRIEF DESCRIPTION OF THE DRAWINGS

The embodiments of the disclosure will be understood and appreciated more fully from the following detailed description, taken in conjunction with the drawings in which:

FIG. 1 illustrates an example of a method;

FIG. 2 illustrates an example of a teacher object detection neural network (ODNN) learning process;

FIG. 3 illustrates an example of a knowledge distillation process;

FIG. 4 illustrates an example of a knowledge distillation process;

FIG. 5 illustrates an example of an object detection process; and

FIG. 6 is an example of an image, different image segments, anchors and a YOLO compliant pre-bounding-box output.

DESCRIPTION OF EXAMPLE EMBODIMENTS

In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be understood by those skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, and components have not been described in detail so as not to obscure the present invention.

The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, both as to organization and method of operation, together with objects, features, and advantages thereof, may best be understood by reference to the following detailed description when read with the accompanying drawings.

It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements.

Because the illustrated embodiments of the present invention may for the most part, be implemented using electronic components and circuits known to those skilled in the art, details will not be explained in any greater extent than that considered necessary as illustrated above, for the understanding and appreciation of the underlying concepts of the present invention and in order not to obfuscate or distract from the teachings of the present invention.

Any reference in the specification to a method should be applied mutatis mutandis to a device or system capable of executing the method and/or to a non-transitory computer readable medium that stores instructions for executing the method.

Any reference in the specification to a system or device should be applied mutatis mutandis to a method that may be executed by the system, and/or may be applied mutatis mutandis to non-transitory computer readable medium that stores instructions executable by the system.

Any reference in the specification to a non-transitory computer readable medium should be applied mutatis mutandis to a device or system capable of executing instructions stored in the non-transitory computer readable medium and/or may be applied mutatis mutandis to a method for executing the instructions.

Any combination of any module or unit listed in any of the figures, any part of the specification and/or any claims may be provided.

There may be provided a highly efficient system and method for object detection.

The highly efficient system benefits from the benefits of both knowledge distillation and from ensemble.

Regarding ensemble—a teacher object detection neural network (ODNN) includes multiple ODNNs that differ from each other (represent different models) and generates a teacher ODNN that benefits from the contribution of the multiple ODNNs. This improves the performance of the teaches ODNN.

In order to enjoy the benefits of the ensemble, the outputs of the ODNNs should be raw or preliminary outputs—and not bounding boxes. There raw or preliminary outputs are also referred to as pre-bounding-box outputs.

The knowledge embedded in the teacher ODNN is distilled to a student ODNN that is much smaller (for example by a factor of at least 5, 10, 50, 100 and the like) to provide a a student ODNN that mimics the teacher ODNN—but at a fraction of cost/ size/ and power consumption of the teacher ODNN.

In order to benefit from the ensambling

In the following figures the teacher ODNN includes three ODNNs—whereas the number of ODNNs of the teacher ODNN may be two or above four.

FIG. 1 illustrated method 7300.

Method 7300 is for object detection.

Method 7300 may include steps 7310 and 7330.

Step 7310 may include training a student object detection neural network (ODNN) to mimic a teacher ODNN. The training may include calculating a teacher student detection loss that is based on a pre-bounding-box output of the teacher ODNN. The pre-bounding-box output of the teacher ODNN is a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN.

The pre-bounding-box outputs of the teacher ODNN is a weighted sum of the pre-bounding-box output of the different ODNNs.

Step 7310 may include step 7312 of calculating, by the teacher ODNN, weights to be applied during a calculation of the weighted sum.

Each one of the pre-bounding-box outputs of the different ODNNs may include an objectiveness confidence level indicative of an existence of an object.

Step 7312 may include applying a function on objectiveness confidence level of the pre-bounding-box outputs of the different ODNNs.

The function may be, for example, a softmax function, a max function, a sigmoid function, and the like.

Step 7312 may include training a weight learning neural network of the teacher ODNN. The training is aimed to determine the weights of the weighted sum.

The calculating of the weight can be done per anchor, per multiple anchors or per all anchors of a set of anchors. The set of anchors is usually a parameter of the object detection method.

The weighted sum may be applied on all outputs of the ODNNs—but may also include applying different weights to different parts of the pre-bounding-box outputs of the different ODNNs.

Step 7310 may be followed by step 7330 of detecting one or more objects in an image.

Step 7330 may include a sequence of steps that includes steps 7332, 7334 and 7336.

Step 7332 may include feeding the image to the trained student ODNN.

Step 7334 may include outputting by the trained student ODNN a student pre-bounding-box output.

Step 7336 may include calculating one or more bounding boxes based on the student pre-bounding-box output.

Step 7310 may include, for example, segmenting an image to regions, and within each region trying to find bonding boxes (of a set of bounding boxes) and the probabilities related to the inclusion of an object within the bounding boxes. Step 7310 may apply object detection algorithms such as but not limited to any one of the Yolo family (for example, —YOLO, YOLO2, YOLO3, and the like).

FIG. 2 illustrates an example of a teacher ODNN learning process which is a supervised learning process.

The teacher ODNN 700 includes three ODNNs (first ODNN 7011, second ODNN 7012, and third ODNN 7013) that differ from each other (represent different models).

The three ODNNs are fed, during the teaches ODNN learning process with first training images TI1 7005 and output first, second and third ODNN output vectors OV1 7021, OV2 7022 and OV2 7033 respectively. These three output vectors are pre-bounding box output vectors.

These three output vectors are sent to a weighted sum unit 7040 that calculates a weighted sum of the three output vectors. The weights used in the calculation of the weighted sum are calculated by a weight learning neural network 7030.

The weighted sum is the output vector (TOV 7042) of the teacher ODNN. During the learning process, output vector TOV 7042 and the expected outcome 7052 (the supervised learning process knows which objects appear in TI1 7005) are fed to a teacher object detection loss unit 7050 that calculates the errors/object detection loss and feeds the error to the weight learning neural network 7030—in order to allow the weight learning neural network 7030 to adjust itself and provide better weights.

It should be noted that the weight learning neural network 7030 may receive the entire first, second and third ODNN output vectors, or only parts of the first, second and third ODNN output vectors. For example—weight may be learnt per anchor, per two or more anchors, and the like.

It should be noted that the calculating of the weighted sum may include applying the weights to the entire first, second and third ODNN output vectors but that different weights may applied to different parts of the first, second and third ODNN output vectors. For example—different fields of the first, second and third ODNN output vectors may be added using different weights.

FIG. 3 illustrates an example of a knowledge distillation process 7002. The knowledge distillation process may be executed after the completion of the teacher ODNN training process illustrated in FIG. 2.

The knowledge distillation process may include feeding second training images TI2 7007 to the teacher ODNN and to the student ODNN 7090 in order to train the student ODNN to mimic the teacher ODNN.

The knowledge distillation process is a supervised training process and the student ODNN 7090 is fed by a teacher student object detection loss (from a teacher student OD loss unit 7080)—that reflects the difference between the outputs of the student and the teacher.

The student ODNN 7090 is also fed by its own object detection loss (difference from expected outcome 7054) calculated by student OD loss unit 7091.

FIG. 4 illustrates an example of a knowledge distillation process 7004 in which the teacher ODNN does not learn the weights by using a weight learning neural network 7030—but rather applies a objectiveness based weight calculation by an objectiveness based weight calculator 7031.

FIG. 5 illustrates an example of an object detection process 7006 that may occur after knowledge distillation process process 7002 or knowledge distillation process process 7004.

Third images 13 7009 that should undergo an object detection process are fed to a student ODNN 7090 (after the student ODNN was trained) that outputs a pre-bounding-box output SOV 7092 that is fed to a bounding box unit 7110 for calculating of bounding boxes.

FIG. 6 is an example of an image 7200 that include a person 7201 and a vehicle 7202. The image is segmented to segments and each segments is processed using the trained student ODNN.

FIG. 6 illustrates three anchors 7205. Each anchor defines the relationship between dimensions (such as a ratio between height and width) of potential bounding boxes.

FIG. 6 also shows an example of a pre-bounding-box output 7210 that may include coordinates (x,y,h,w) 7211, objectiveness 7212 and class 7213. The coordinate indicate the location (x,y) as well as the height and width. Objectiveness 7212 provides a confidence level that an object exists. Class- class of object—for example cat, dog, vehicle, person . . . ). Wherein x,y are coordinates (for example row and column), h is the heights and w is the width.

While the foregoing written description of the invention enables one of ordinary skill to make and use what is considered presently to be the best mode thereof, those of ordinary skill will understand and appreciate the existence of variations, combinations, and equivalents of the specific embodiment, method, and examples herein. The invention should therefore not be limited by the above described embodiment, method, and examples, but by all embodiments and methods within the scope and spirit of the invention as claimed.

In the foregoing specification, the invention has been described with reference to specific examples of embodiments of the invention. It will, however, be evident that various modifications and changes may be made therein without departing from the broader spirit and scope of the invention as set forth in the appended claims.

Moreover, the terms “front,” “back,” “top,” “bottom,” “over,” “under” and the like in the description and in the claims, if any, are used for descriptive purposes and not necessarily for describing permanent relative positions. It is understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in other orientations than those illustrated or otherwise described herein.

Furthermore, the terms “assert” or “set” and “negate” (or “deassert” or “clear”) are used herein when referring to the rendering of a signal, status bit, or similar apparatus into its logically true or logically false state, respectively. If the logically true state is a logic level one, the logically false state is a logic level zero. And if the logically true state is a logic level zero, the logically false state is a logic level one.

Those skilled in the art will recognize that the boundaries between logic blocks are merely illustrative and that alternative embodiments may merge logic blocks or circuit elements or impose an alternate decomposition of functionality upon various logic blocks or circuit elements. Thus, it is to be understood that the architectures depicted herein are merely exemplary, and that in fact many other architectures may be implemented which achieve the same functionality.

Any arrangement of components to achieve the same functionality is effectively “associated” such that the desired functionality is achieved. Hence, any two components herein combined to achieve a particular functionality may be seen as “associated with” each other such that the desired functionality is achieved, irrespective of architectures or intermedial components. Likewise, any two components so associated can also be viewed as being “operably connected,” or “operably coupled,” to each other to achieve the desired functionality.

Furthermore, those skilled in the art will recognize that boundaries between the above described operations merely illustrative. The multiple operations may be combined into a single operation, a single operation may be distributed in additional operations and operations may be executed at least partially overlapping in time. Moreover, alternative embodiments may include multiple instances of a particular operation, and the order of operations may be altered in various other embodiments.

Also for example, in one embodiment, the illustrated examples may be implemented as circuitry located on a single integrated circuit or within a same device. Alternatively, the examples may be implemented as any number of separate integrated circuits or separate devices interconnected with each other in a suitable manner

However, other modifications, variations and alternatives are also possible. The specifications and drawings are, accordingly, to be regarded in an illustrative rather than in a restrictive sense.

In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word ‘comprising’ does not exclude the presence of other elements or steps then those listed in a claim. Furthermore, the terms “a” or “an,” as used herein, are defined as one or more than one. Also, the use of introductory phrases such as “at least one” and “one or more” in the claims should not be construed to imply that the introduction of another claim element by the indefinite articles “a” or “an” limits any particular claim containing such introduced claim element to inventions containing only one such element, even when the same claim includes the introductory phrases “one or more” or “at least one” and indefinite articles such as “a” or “an.” The same holds true for the use of definite articles. Unless stated otherwise, terms such as “first” and “second” are used to arbitrarily distinguish between the elements such terms describe. Thus, these terms are not necessarily intended to indicate temporal or other prioritization of such elements. The mere fact that certain measures are recited in mutually different claims does not indicate that a combination of these measures cannot be used to advantage.

While certain features of the invention have been illustrated and described herein, many modifications, substitutions, changes, and equivalents will now occur to those of ordinary skill in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the invention.

It is appreciated that various features of the embodiments of the disclosure which are, for clarity, described in the contexts of separate embodiments may also be provided in combination in a single embodiment. Conversely, various features of the embodiments of the disclosure which are, for brevity, described in the context of a single embodiment may also be provided separately or in any suitable sub-combination.

It will be appreciated by persons skilled in the art that the embodiments of the disclosure are not limited by what has been particularly shown and described hereinabove. Rather the scope of the embodiments of the disclosure is defined by the appended claims and equivalents thereof. 

What is claimed is:
 1. A method for object detection, the method comprises: training a student object detection neural network (ODNN) to mimic a teacher ODNN; wherein the training comprises calculating a teacher student detection loss that is based on a pre-bounding-box output of the teacher ODNN; wherein the pre-bounding-box output of the teacher ODNN is a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN; and detecting one or more objects in an image; wherein the detecting comprises: feeding the image to the trained student ODNN; outputting by the trained student ODNN a student pre-bounding-box output; and calculating one or more bounding boxes based on the student pre-bounding-box output.
 2. The method according to claim 1 wherein the pre-bounding-box outputs of the teacher ODNN is a weighted sum of the pre-bounding-box output of the different ODNNs; and wherein the method comprises calculating, by the teacher ODNN, weights to be applied during a calculation of the weighted sum.
 3. The method according to claim 2 wherein each one of the pre-bounding-box outputs of the different ODNNs comprises an objectiveness confidence level indicative of an existence of an object; and wherein the calculating of the weights comprises applying a function on objectiveness confidence level of the pre-bounding-box outputs of the different ODNNs.
 4. The method according to claim 3 wherein the function is a softmax function.
 5. The method according to claim 3 wherein the function is a max function.
 6. The method according to claim 3 wherein the function is a sigmoid function.
 7. The method according to claim 2 wherein the calculating of the weights comprises training a weight learning neural network of the teacher ODNN.
 8. The method according to claim 7 wherein the calculating of the weight is done per anchor out of a set of anchors.
 9. The method according to claim 2 comprising calculating the weighted sum of the pre-bounding-box outputs of the different ODNNs by applying different weights to different parts of the pre-bounding-box outputs of the different ODNNs.
 10. An object detection system that comprises a trained student object detection neural network (ODNN) that was trained to mimic a teacher ODNN; wherein the training comprises calculating a teacher student detection loss that is based on a pre-bounding-box output of the teacher ODNN; wherein the pre-bounding-box output of the teacher ODNN is a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN; wherein the trained student ODNN is configured to receive a image and output a student pre-bounding-box output that is indicative of one or more objects in the image; and a bounding box unit that is configured to receive the student pre-bounding-box output and to calculate one or more bounding boxes based on the student pre-bounding-box output.
 11. A non-transitory computer readable medium that stores instructions for: training a student object detection neural network (ODNN) to mimic a teacher ODNN; wherein the training comprises calculating a teacher student detection loss that is based on a pre-bounding-box output of the teacher ODNN; wherein the pre-bounding-box output of the teacher ODNN is a function of pre-bounding-box outputs of different ODNNs that belong to the teacher ODNN; and detecting one or more objects in an image; wherein the detecting comprises: feeding the image to the trained student ODNN; outputting by the trained student ODNN a student pre-bounding-box output; and calculating one or more bounding boxes based on the student pre-bounding-box output.
 12. The non-transitory computer readable medium according to claim 11 wherein the pre-bounding-box outputs of the teacher ODNN is a weighted sum of the pre-bounding-box output of the different ODNNs; and wherein the method comprises calculating, by the teacher ODNN, weights to be applied during a calculation of the weighted sum.
 13. The non-transitory computer readable medium according to claim 12 wherein each one of the pre-bounding-box outputs of the different ODNNs comprises an objectiveness confidence level indicative of an existence of an object; and wherein the calculating of the weights comprises applying a function on objectiveness confidence level of the pre-bounding-box outputs of the different ODNNs.
 14. The non-transitory computer readable medium according to claim 13 wherein the function is a softmax function.
 15. The non-transitory computer readable medium according to claim 13 wherein the function is a max function.
 16. The non-transitory computer readable medium according to claim 13 wherein the function is a sigmoid function.
 17. The non-transitory computer readable medium according to claim 12 wherein the calculating of the weights comprises training a weight learning neural network of the teacher ODNN.
 18. The non-transitory computer readable medium according to claim 17 wherein the calculating of the weight is done per anchor out of a set of anchors.
 19. The non-transitory computer readable medium according to claim 12 that stores instructions for calculating the weighted sum of the pre-bounding-box outputs of the different ODNNs by applying different weights to different parts of the pre-bounding-box outputs of the different ODNNs. 